package com.example.ormsqlsplicingframe1.sql.impl;

import com.example.ormsqlsplicingframe1.sql.ConditionSql;
import com.example.ormsqlsplicingframe1.sql.SelectFieldSql;
import com.example.ormsqlsplicingframe1.sql.SelectSql;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;

/**
 *  count(name) as as Name
 * select   id as id,name as name  f from  dsa w where
 */
public class SelectFieldsSql implements SelectFieldSql {

    private StringJoiner sb = new StringJoiner(",");
    @Override
    public SelectFieldSql field(String name, String asName) {

        sb.add(name+" as "+asName);

        return this;
    }

    @Override
    public SelectFieldSql count(String name, String asName) {
        sb.add("count("+name+") as "+asName);
        return this;
    }

    @Override
    public SelectFieldSql sum(String name, String asName) {
        sb.add("sum("+name+") as"+asName);
        return this;
    }

    @Override
    public SelectFieldSql mix(String name, String asName) {
        sb.add("mix("+name+") as "+asName);
        return this;
    }

    @Override
    public SelectFieldSql dateFormat(String name, String format, String asName) {
        return this;
    }

    @Override
    public SelectFieldSql day(String name, String asName) {
        return this;
    }

    @Override
    public SelectFieldSql month(String name, String asName) {
        return this;
    }

    @Override
    public SelectFieldSql year(String name, String asName) {
        return this;
    }

    @Override
    public String getSql() {
        return sb.toString();
    }

    @Override
    public List<Object> getValues() {
        return null;
    }
}
